import {SlateElement} from '@wangeditor/editor'
import {GapElement} from './renderElem.ts'

function parseGapElHtml(domElem: Element): SlateElement {
	const gapNum = domElem.getAttribute('data-gap-num')!
	return {
		type: 'gapFilling',
		gapNum: Number(gapNum),
		children: [{text: ''}]
	} as GapElement
}

export const parseGapHtmlConf = {
	selector: 'span[data-w-e-type="gapFilling"]', // 这个就是elem-html.ts中第一个div里包含的信息
	parseElemHtml: parseGapElHtml
}
